A recent CMOS image sensor has employed a method to use, as an autofocus function of a camera, a focus detection pixel having asymmetric sensitivity to an incident angle of light. As a method to realize a focus detection pixel, a method to arrange a pixel pair having a first pixel in which a right half thereof is opened by a light shielding film, and a second pixel, in which a left half thereof is opened, has been provided (see, for example, JP 2009-99817 A and JP 2011-171749 A). The method is similar to both of an image sensor of a surface irradiation type and an image sensor of a rear surface irradiation type. Also, to increase asymmetry of sensitivity of a focus detection pixel, a light shielding film is formed in the vicinity of a silicon layer to which a photodiode is formed, as close as possible.